﻿using System;
using System.Collections.Generic;
using System.Text;

namespace daSyntaxAnalyser.SyntaxTree
{
    using daBase.Objects;

    public class PrefixedFunctionVarDeclarationElement : FunctionVarDeclarationElement
    {
        private TokenInfo prefix;

        public TokenInfo Prefix { get { return prefix; } set { prefix = value; } }

        public PrefixedFunctionVarDeclarationElement(TokenInfo Prefix, List<IdElement> Ids, ITypeElement Type, bool IsPlatform, ISyntaxTreeElement Value, List<TokenInfo> Comments)
            : base(Prefix, Ids, Type, IsPlatform, Value, Comments)
        {
            prefix = Prefix;
        }

        public PrefixedFunctionVarDeclarationElement(TokenInfo Prefix, FunctionVarDeclarationElement Var, List<TokenInfo> Comments) : this(Prefix, Var.Ids, Var.Type, Var.IsPlatform, Var.Value, List<TokenInfo>.Combine(Var.Comments, Comments)) { }

        public override string ToString()
        {
            return string.Format("{0} {1}", prefix, base.ToString());
        }
    }
}
